package com.diaohw.module.websocket.obj.bo;

import com.diaohw.platform.common.util.JsonUtil;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class WsOfflineBo {

    private LocalDateTime online;

    private LocalDateTime offline;

    private Long seconds;

    public static WsOfflineBo of(LocalDateTime online, LocalDateTime offline, Long seconds) {
        WsOfflineBo bo = new WsOfflineBo();
        bo.setOnline(online);
        bo.setOffline(offline);
        bo.setSeconds(seconds);
        return bo;
    }

    public static String ofStr(LocalDateTime online, LocalDateTime offline, Long seconds) {
        WsOfflineBo bo = of(online, offline, seconds);
        return JsonUtil.toJsonString(bo);
    }


}
